package com.javaclimb.filmbuy.dao;

import com.javaclimb.filmbuy.entity.SeatInfo;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;

/**
 * 座位信息dao层
 */
@Repository
public interface SeatInfoDao extends Mapper<SeatInfo> {
    /**
    *根据电影id查询有哪些座位已售
    */
    @Select("select * from seat_info s join order_goods_rel r on s.goodsId=r.goodsId join order_info o"+
    "on o.id=r.orderId where(o.status='待观看' or o.status='待付款') and s.goodsId=#{goodsId} limit 1")
   SeatInfo findDetail(Long goodsId);
}

